package com.example.zwgt.yrfk.ui.risk.activity;

import android.content.Intent;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.widget.ImageView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.example.zwgt.yrfk.R;
import com.example.zwgt.yrfk.base.mvpbase.BasePresenter;
import com.example.zwgt.yrfk.base.mvpbase.baseImpl.BaseActivity;
import com.example.zwgt.yrfk.ui.risk.adapter.SelectIndexAdapter;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import butterknife.OnClick;

public class SelectIndexActivity extends BaseActivity {
    @BindView(R.id.risk_list)
    RecyclerView riskList;
    private SelectIndexAdapter adapter;
    private List<String> data = new ArrayList<>();
    @BindView(R.id.iv_back)
    ImageView ivBack;


    @Override
    public BasePresenter initPresenter() {
        return null;
    }

    @Override
    public int getLayoutId() {
        return R.layout.activity_select_index;
    }

    @Override
    protected void initViews() {
        data.add("指标名称 : A");
        data.add("指标名称 : B");
        data.add("指标名称 : C");
        data.add("指标名称 : D");
        data.add("指标名称 : E");
        data.add("指标名称 : F");
        data.add("指标名称 : G");
        data.add("指标名称 : H");
        data.add("指标名称 : I");
        data.add("指标名称 : J");
        data.add("指标名称 : K");
        data.add("指标名称 : L");
        data.add("指标名称 : M");
        data.add("指标名称 : N");
        riskList.setLayoutManager(new LinearLayoutManager(this));
        adapter = new SelectIndexAdapter(R.layout.layout_select_index_item, data);
        adapter.openLoadAnimation(BaseQuickAdapter.LOADING_VIEW);
        riskList.setAdapter(adapter);
        adapter.setOnItemClickListener((adapter, view, position) -> startActivity(new Intent(SelectIndexActivity.this,IndexDetailsActivity.class)));

    }

    @OnClick(R.id.iv_back)
    public void onViewClicked() {
        finish();
    }

}
